Skip to content

chore: add agent-run dashboard flow checks and Magellan explorer - #8321

Draft
adaam2 wants to merge 13 commits into
mainfrom
adaam2/ux-drift-detection-agent-b23c7d9a
Draft

adaam2 wants to merge 13 commits into
mainfrom
adaam2/ux-drift-detection-agent-b23c7d9a

Conversation

@adaam2

@adaam2 adaam2 commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

DES-432

Summary

Two agent-driven tools for catching dashboard UX drift. Neither blocks merges. Both run their agents on GitHub Agentic Workflows (gh-aw) in its AWF sandbox, not on custom sandboxing.

Flow checks (e2e/flows/, .github/workflows/flow-checks.md) protect known flows:

  • Each flow is a plain-English story.md (Given / When / Then, with every Then proven by an /rpc/ call, not by text on screen) next to a Playwright flow.spec.ts that a Claude Code agent compiled from it.
  • On PRs that touch the dashboard, ordinary workflow steps boot the stack and run mise run test:flows. If every flow passes, the run ends there with no LLM.
  • If a flow fails, a Claude Code agent re-walks each failing story (.github/prompts/heal-flow.md) inside the AWF sandbox and returns one verdict per flow:
    • healed: the UI moved; it rewrites the script, which is attached to the run as the healed-flows artifact.
    • broken: the flow can't be finished.
    • changed: the PR changes the flow on purpose, so the story needs an edit.
  • It posts one PR comment (a gh-aw safe output) with the verdicts and the commands to replay and heal each flow locally (mise run test:flows flows/<flow>/, mise run flows:heal <flow>).
  • Three starter flows: server-from-source (fully repeatable), assistant-create (needs an LLM key; skipped without one), catalog-connect (uses the live registry).

Magellan (e2e/magellan/) is a nightly explorer for problems no story covers. It runs against production, in a dedicated integration org, as a bot user. Its gh-aw workflow lives in speakeasy-api/gram-infra (.github/workflows/magellan.md), because gh-aw uploads every run's agent transcript as an artifact and this repo is public. That workflow checks out this repo's main for the prompt (.github/prompts/magellan-explore.md) and the filer.

  • A finding needs hard evidence (console error, failed RPC, dead end, race, or a control with no accessible name) and must reproduce twice.
  • Findings leave the agent only through a file_finding safe output. A separate job, holding the Linear key, runs mise run magellan:file --agent-output, which validates each finding, deduplicates by fingerprint so a bug seen on several nights stays one Linear issue, and puts agent text into Linear only inside code blocks.
  • mise run magellan:explore still works against the local stack, unsandboxed, for trying out prompt changes.

How the agents are contained

All of this comes from gh-aw and AWF, not from code in this PR:

  • The agent runs in AWF's container. Its egress is limited by AWF's firewall: for flow checks, the stack's dashboard, server and dev-idp ports on the runner (docker-sudo-iptables profile with allow-host-ports); for Magellan, app.getgram.ai.
  • ANTHROPIC_API_KEY is excluded from the agent's environment; AWF's API proxy holds it.
  • The agent writes back only through safe outputs (PR comment, artifact, Linear filing job), each run in a separate job with its own token or secret.
  • gh-aw runs threat detection on the agent's output before any safe output is applied, and redacts the workflow's secrets from uploaded logs.
  • Compiled with gh-aw v1.2.1 in action mode, so every gh-aw action is pinned to github/gh-aw-actions@406c7719e31d7fe354224d4bb8fe3d4aeb47da1c and every container image to a digest.

Security review (gh-aw compile)

gh aw compile asked for a review of what this compilation adds:

  • ANTHROPIC_API_KEY (secret): the engine credential. Excluded from the agent container (--exclude-env) and held by AWF's API proxy. Safe.
  • ATLAS_TOKEN (secret): needed by ./zero --agent to run migrations. Set only on the "Boot the stack" step, which runs outside the sandbox before the agent starts. Same use as wake-stack-e2e.yml. Safe.
  • jdx/mise-action (action): pinned to 9149ea85001c7435d5a66bb127d6a1b6227cb0a5 (v5.0.0), the same pin the repo already uses elsewhere. Safe.

.github/zizmor.yml ignores three low audits on the generated flow-checks.lock.yml (it can't carry inline comments); the reasons are in the file. .oxfmtrc.json ignores *.lock.yml, since reformatting a lock file would break gh-aw's source check.

Motivation

Changes can quietly break whether a user can finish a flow, and nothing catches it today. Running an agent as the per-PR gate would be slow, costly and too willing to say "pass". Here the agent writes and repairs scripts, the scripts do the gating, and the open-ended exploring runs nightly instead.

Findings from the spike:

  • Heal runs take 6–16 minutes each, so the agent runs only when a replay fails.
  • Flows that depend on an LLM or a live upstream server are better suited to the nightly run than to every PR.
  • Magellan's first local run reported findings that came from the local stack (feature gates off, state from earlier runs). That is why Magellan targets production.

Setup before first run

  • This repo: no new secrets (ANTHROPIC_API_KEY and ATLAS_TOKEN exist).
  • speakeasy-api/gram-infra: a magellan environment restricted to main, with MAGELLAN_ORG, MAGELLAN_SESSION, ANTHROPIC_API_KEY and MAGELLAN_LINEAR_API_KEY (details in that workflow's header). Its filing job runs mise run magellan:file --agent-output, which exists only once this PR merges.

Gutternote review steps

No user-visible change: this PR adds tooling only.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PXf4pFQMBT5vL8roKYJdbW

@adaam2 adaam2 added github_actions Pull requests that update GitHub Actions code automation labels Oct 30, 2026
@changeset-bot

changeset-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 451c33d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@linear-code

linear-code Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

DES-432

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 19 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .mise-tasks/magellan/explore.sh Resolved
Comment thread .github/workflows/flow-checks.yml Resolved
Comment thread .github/workflows/magellan.yml Resolved
Comment thread e2e/flows/assistant-create/story.md Resolved
Comment thread .github/workflows/flow-checks.yml Resolved
Comment thread e2e/flows/assistant-create/story.md Resolved
Comment thread e2e/flows/fixtures.ts Resolved
Comment thread .mise-tasks/magellan/file.mts Resolved
Comment thread .mise-tasks/magellan/explore.sh Resolved
Comment thread .mise-tasks/magellan/file.mts Resolved
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Flow checks

Flow Verdict Step Summary
catalog-connect unknown the agent did not return a verdict

healed: the UI moved but the flow still works; the new script is in the run's flow-checks artifact under healed/<flow>/.
broken: a user can no longer finish the flow.
changed: this PR changes the flow on purpose; update its story.md.

Check or heal a flow on your machine:

mise run test:flows flows/catalog-connect/   # replay it
mise run flows:heal catalog-connect          # heal it, or find out why it broke

Run, traces and screenshots. This check does not block merging.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .github/workflows/magellan.yml Resolved
Comment thread .mise-tasks/magellan/explore.sh Resolved
Comment thread .mise-tasks/magellan/explore.sh Resolved
Comment thread e2e/magellan/EXPLORE.md Resolved
Comment thread e2e/magellan/README.md Resolved
Comment thread .github/workflows/magellan.yml Resolved
Comment thread .mise-tasks/magellan/file.mts Resolved
Comment thread .mise-tasks/magellan/file.mts Resolved
Comment thread .mise-tasks/magellan/explore.sh Resolved
Comment thread .github/workflows/magellan.yml Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 13 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .github/workflows/magellan.yml Resolved
Comment thread e2e/magellan/README.md Resolved
Comment thread e2e/magellan/EXPLORE.md Resolved
Comment thread .mise-tasks/magellan/explore.sh Resolved
Comment thread .mise-tasks/magellan/explore.sh Resolved
Comment thread .github/workflows/magellan.yml Resolved
Comment thread .mise-tasks/magellan/file.mts Resolved
Comment thread .mise-tasks/magellan/file.mts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 23 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread e2e/agent-jail/jail.sh Resolved
Comment thread e2e/magellan/browser.mjs Resolved
Comment thread e2e/agent-jail/README.md Resolved
Comment thread e2e/magellan/explore-ci.sh Resolved
Comment thread e2e/agent-jail/proxy.mjs Resolved
Comment thread e2e/agent-jail/proxy.mjs Resolved
Comment thread e2e/magellan/README.md Resolved
Comment thread .mise-tasks/magellan/file.mts Resolved
Comment thread .github/workflows/flow-checks.yml Resolved
Comment thread .github/workflows/magellan.yml Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXf4pFQMBT5vL8roKYJdbW

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 16 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread e2e/agent-jail/jail.sh Resolved
Comment thread .mise-tasks/magellan/explore.sh Resolved
Comment thread .github/workflows/flow-checks.yml Resolved
Comment thread e2e/agent-jail/proxy.mjs Resolved
Comment thread e2e/agent-jail/proxy.test.mjs Resolved
Comment thread e2e/magellan/README.md Resolved
Comment thread e2e/agent-jail/jail.sh Resolved
Comment thread e2e/flows/jail-bin/flow-browser Resolved
Comment thread e2e/agent-jail/proxy.mjs Resolved
Comment thread e2e/agent-jail/README.md Resolved
…om jail

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXf4pFQMBT5vL8roKYJdbW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXf4pFQMBT5vL8roKYJdbW

adaam2 commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Flow checks / activation is red on this PR by design and can't go green before merge.

On pull requests, GitHub Agentic Workflows builds the agent's prompt from the base branch's .github folder, not the PR's, so a PR can't rewrite its own agent's instructions. .github/workflows/flow-checks.md doesn't exist on main yet, so activation fails with ENOENT ... .github/workflows/flow-checks.md (run). The workflow starts running on PRs once this one merges.

The same run exposed a real bug: the prompt import compiled to .github/workflows/prompts/heal-flow.md. a240aaa fixes it to .github/prompts/heal-flow.md.

The check doesn't block merging.


Generated by Claude Code

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 30 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .gitattributes Resolved
Comment thread e2e/flows/README.md Resolved
Comment thread .github/zizmor.yml Resolved
Comment thread .github/zizmor.yml Resolved
Comment thread .github/prompts/magellan-explore.md Resolved
Comment thread .mise-tasks/magellan/file.mts Resolved
…e Linear filer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXf4pFQMBT5vL8roKYJdbW
…le zizmor exemptions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXf4pFQMBT5vL8roKYJdbW

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 14 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .mise-tasks/flows/heal.test.mts Resolved
Comment thread .mise-tasks/magellan/file.test.mts Resolved
Comment thread .mise-tasks/flows/flow-checks.test.mts Resolved
Comment thread .mise-tasks/flows/flow-checks.test.mts Resolved
Comment thread .github/filters.yaml Resolved
Comment thread .mise-tasks/flows/heal.test.mts Resolved
…oxed agent can reach it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXf4pFQMBT5vL8roKYJdbW
…ighten the agent-check tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXf4pFQMBT5vL8roKYJdbW

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 14 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .mise-tasks/flows/sandbox-host.mts Resolved
Comment thread .mise-tasks/zero/env-deps.mts Resolved
Comment thread .github/filters.yaml Resolved
Comment thread .mise-tasks/flows/sandbox-host.mts Resolved
…setup and require an explicit bind address

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXf4pFQMBT5vL8roKYJdbW

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants